function score = seeNeuralNetworkPlay(weights, pieces)

% clc;

tableHeight = 12;
tableWidth = 6;
pieceNum = length(pieces);

table = zeros(tableHeight, tableWidth);
score = 0;

% dispTable(table);
% disp(['Score: ', num2str(score)]);

while true
    piece = pieces(randi(pieceNum));

    [inputs, tables, moveScores, ~, legalMoves] = formInputs(table, piece);
    quality = predictQuality(weights, inputs);
    
    [~, bestInd] = max(quality);
    
%     tetromino = generateTetromino(piece, legalMoves(2, bestInd));
%     disp('Figura:');
%     disp(tetromino);
%     disp(['Pozicija: ', num2str(legalMoves(1, bestInd))]);
    
    table = tables{bestInd};
    if moveScores(bestInd) ~= -800
        score = score + moveScores(bestInd);
    end

%     dispTable(table);
%     disp(['Score: ', num2str(score)]);
    
    if moveScores(bestInd) == -800
        break;
    end
%     pause;
end

